from rest_framework import generics
from answer.serializer.task_serializer import \
    Task, \
    TaskSubmit, \
    TaskQuestion, \
    TaskSerializer, \
    TaskQuestionSerializer, \
    TaskSubmitSerializer


class TaskList(generics.ListCreateAPIView):
    queryset = Task.objects.all()
    serializer_class = TaskSerializer


class TaskSubmitList(generics.ListCreateAPIView):
    queryset = TaskSubmit.objects.all()
    serializer_class = TaskSubmitSerializer


class TaskQuestionList(generics.ListCreateAPIView):
    queryset = TaskQuestion.objects.all()
    serializer_class = TaskQuestionSerializer


class TaskDetail(generics.RetrieveUpdateDestroyAPIView):
    queryset = Task.objects.all()
    serializer_class = TaskSerializer


class TaskSubmitDetail(generics.RetrieveUpdateDestroyAPIView):
    queryset = TaskSubmit.objects.all()
    serializer_class = TaskSubmitSerializer


class TaskQuestionDetail(generics.RetrieveUpdateDestroyAPIView):
    queryset = TaskQuestion.objects.all()
    serializer_class = TaskQuestionSerializer
